package xyz.chaobei.thread.vol;

/**
 * @copyright (C), 2015-2020
 * @fileName: VolatileTest
 * @author: MRC
 * @date: 2021/2/1 22:49
 * @description:
 */
public class VolatileTest {

    public static void main(String[] args) {

        VolatileObj obj = new VolatileObj();

        Thread thread1 = new Thread(() -> {
            // write
            obj.writer();
        });

        Thread thread2 = new Thread(() -> {
            // reader
            obj.reader();
        });

        thread1.start();
        thread2.start();

    }

}
